package com.mezz.bones.im.common.message.base;

import com.mezz.bones.im.common.enums.ActionCodeEnum;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author: zhuang
 * @Date: 2024/11/29 18:17
 * @Description: IM连接channel数据基类
 * @Version: 1.0
 **/
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
@ApiModel("消息请求数据")
public class Message {

    private MessageHeader header;
    private Object body;

    public Integer codeType(){
        String actionCode = this.getHeader().getActionCode();
        return ActionCodeEnum.findEnum(actionCode).getCodeType();
    }
}
